home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- import java.util.Vector;
- import javax.swing.undo.AbstractUndoableEdit;
- import javax.swing.undo.CannotRedoException;
- import javax.swing.undo.CannotUndoException;
-
- class StringContent$InsertUndo extends AbstractUndoableEdit {
- // $FF: synthetic field
- private final StringContent this$0;
- protected int offset;
- protected int length;
- protected String string;
- protected Vector posRefs;
-
- protected StringContent$InsertUndo(StringContent var1, int var2, int var3) {
- this.this$0 = var1;
- this.offset = var2;
- this.length = var3;
- }
-
- public void redo() throws CannotRedoException {
- super.redo();
-
- try {
- StringContent var1 = this.this$0;
- synchronized(var1){}
-
- try {
- this.this$0.insertString(this.offset, this.string);
- this.string = null;
- if (this.posRefs != null) {
- this.this$0.updateUndoPositions(this.posRefs);
- this.posRefs = null;
- }
- } catch (Throwable var4) {
- throw var4;
- }
-
- } catch (BadLocationException var5) {
- throw new CannotRedoException();
- }
- }
-
- public void undo() throws CannotUndoException {
- super.undo();
-
- try {
- StringContent var1 = this.this$0;
- synchronized(var1){}
-
- try {
- if (this.this$0.marks != null) {
- this.posRefs = this.this$0.getPositionsInRange((Vector)null, this.offset, this.length);
- }
-
- this.string = this.this$0.getString(this.offset, this.length);
- this.this$0.remove(this.offset, this.length);
- } catch (Throwable var4) {
- throw var4;
- }
-
- } catch (BadLocationException var5) {
- throw new CannotUndoException();
- }
- }
- }
-